/*
 * @Title MyInterceptor.java
 * @Description
 * @Copyright Copyright(c) 2018
 * @Company com.lizhen
 * @author lizhen
 * @version 0.0.1
 */
package com.lizhen.struts2.interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * @author lizhen
 */
public class MyInterceptor extends AbstractInterceptor {

    private static final long serialVersionUID = 1L;

    /**
     * @author lizhen
     */
    public MyInterceptor() {
    }

    /**
     * @author lizhen
     */
    public static void main(String[] args) {
    }

    public String intercept(ActionInvocation invocation) throws Exception {
        /* let us do some pre-processing */
        String output = "Pre-Processing";

        System.out.println(output);

        /* let us call action or next interceptor */
        String result = invocation.invoke();
        /* let us do some post-processing */
        output = "Post-Processing";

        System.out.println(output);

        return result;
    }

}
